package com.ruoyi.student.service.impl;

import com.ruoyi.student.domain.Plan;
import com.ruoyi.student.domain.Student;
import com.ruoyi.student.mapper.PlanMapper;
import com.ruoyi.student.service.IPlanService;
import com.ruoyi.student.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lewis
 * @type class
 * @description
 * @since 2024/9/23
 */
@Service
public class PlanServiceImpl implements IPlanService {
    @Autowired
    private PlanMapper planMapper;
    @Autowired
    private IStudentService studentService;
    @Override
    public Plan selectPlanByStudentId(Long id) {
        Student student = studentService.selectStudentByUserId(id);
        if(student == null) {
            return null;
        }
        return planMapper.selectPlanByStudentId(student.getStudentId());
    }
}
